import Vue from 'vue'
import Vuex from 'vuex'
import { User } from './modules/user'
import { Menu } from './modules/menu'
import { Resource } from './modules/resource'
import { Tag} from './modules/tag'
import persistedState from 'vuex-persistedstate' //vuex持久化存储
import { getters } from './getters'

Vue.use(Vuex)

export default new Vuex.Store({
	// plugins: [
	// 	persistedState({
	// 		storage: window.localStorage, // 存储方式：localStorage、sessionStorage、cookies
	// 		key: 'store' // 存储的 key 的key值
	// 	})
	// ],
	modules: {
		User,
		Menu,
		Resource,
		Tag
	},
	getters
})
